﻿// project02.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <Windows.h>
#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
    // 调用 GetLogicalDrives 函数
    DWORD drives = GetLogicalDrives();

    // 检查每一个驱动器（从A到Z）
    char driveLetter = 'A';
    for (int i = 0; i < 26; ++i) {
        // 检查第i位是否为1
        if (drives & (1 << i)) {
            std::cout << "Drive " << char(driveLetter + i) << ": exists\n";
        }
        else {
            std::cout << "Drive " << char(driveLetter + i) << ": does not exist\n";
        }
        //driveLetter++;
    }

    return 0;
}

